import java.io.*;
import java.awt.*;

public class File_work
{
    public File_work(){}

    public void File_op(String name, Applet_writer input_frame)
    {
        try 
        {
            FileReader fil1 = new FileReader(name);
            BufferedReader bufr = new BufferedReader(fil1);
            String s;     
            input_frame.inp_text.setText("");
            while ((s = bufr.readLine()) != null) 
            {
                input_frame.inp_text.append(s + "\n");
            }
            fil1.close();
        } 
        catch (IOException e)
        {
            System.out.println("File not found");
            return;
        }
    }
    public void Code_save(String name, Applet_writer input_frame)
    {
        try
        {
            FileWriter fil2 = new FileWriter(name);
            String gh = input_frame.out_text.getText(); 
            fil2.write(gh);
            fil2.close();
        }
        catch(IOException e)
        {
            System.out.println("Error of open file");
            return;
        }    
    }
}